///////////////////////////////////////////////////////////
///////////////// Have an itch? Scratch it! ///////////////
///////////////////////// SCRATCH /////////////////////////
/////////////////////  A MUD  Server   ////////////////////
///////////////////// By: Jared Devall ////////////////////
/////////////////////      Thanks:     ////////////////////
/////////////////////  DIKU/Merc/ROM   ////////////////////
///////////////////// Aetas/Deus Gang  ////////////////////
/////////////////////       Beej       ////////////////////
///////////////////////////////////////////////////////////

#ifndef __SPLIT_H_
#define __SPLIT_H_

#include <string>
#include <vector>

// Thanks Unifex


std::string quotesSplit( const std::string &, const std::string & );

// split (const source, dest, dest, ...)
// Splits the source into space-delimited words.  The last destination holds the
//   rest of the string, if any remains.
std::vector< std::string >  split( const std::string &, char );

std::string::const_iterator split( const std::string &, std::string & );
std::string::const_iterator split( const std::string &, std::string &, std::string & );
std::string::const_iterator split( const std::string &, std::string &, std::string &, std::string & );
std::string::const_iterator split( const std::string &, std::string &, std::string &, std::string &, std::string & );

std::string::const_iterator split( const std::string &, std::string &, char );
std::string::const_iterator split( const std::string &, std::string &, std::string &, char );
std::string::const_iterator split( const std::string &, std::string &, std::string &, std::string &, char );
std::string::const_iterator split( const std::string &, std::string &, std::string &, std::string &, std::string &, char );

// getword (const source, dest, delim)
// Splits the source into delimited tokens.  Used by split().
std::string::const_iterator getword ( const std::string &, std::string &, const char = ' ' );
std::string::const_iterator getword ( std::string::const_iterator, std::string::const_iterator, std::string &, const char = ' ' );

#endif // __SPLIT_H

